package com.neuedu.mapper;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.neuedu.pojo.Item;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author han
 * @since 2020-09-21
 */
public interface ItemMapper extends BaseMapper<Item> {
    @Select("SELECT i.*,t.type_name typeName,p.username username FROM item i\n" +
            "LEFT JOIN type t ON i.type_id=t.id\n" +
            "LEFT JOIN principal p ON i.principal_id=p.id ${ew.customSqlSegment}")
    IPage<Item> list(IPage<Item> page, @Param(Constants.WRAPPER) Wrapper wrapper);


}
